package com.fiberhome.ztelauncher.core.page.model;


import com.fiberhome.ztelauncher.core.page.type.TypeFactory;
import com.fiberhome.ztelauncher.xml.bean.LaunchDataPage;
import com.fiberhome.ztelauncher.xml.bean.LauncherLayout;

/**
 * Created by xc on 2018/3/27.
 */

public class AppType extends ImageType implements Visitable {

    private int width;
    private int height;

    public AppType(LauncherLayout.Element layoutElement,
                   LaunchDataPage.Element dataElement, LauncherLayout.Page page) {
        super(layoutElement, dataElement, page);
    }

    public AppType(LauncherLayout.Element layoutElement,
                   LaunchDataPage.Element dataElement, LauncherLayout.Page page, int width, int height) {
        super(layoutElement, dataElement, page);
        this.width = width;
        this.height = height;
    }

    /**
     * get value
     *
     * @return value
     */
    public int getWidth() {
        return width;
    }

    /**
     * set value
     *
     * @param width value
     */
    public AppType setWidth(int width) {
        this.width = width;
        return this;
    }

    /**
     * get value
     *
     * @return value
     */
    public int getHeight() {
        return height;
    }

    /**
     * set value
     *
     * @param height value
     */
    public AppType setHeight(int height) {
        this.height = height;
        return this;
    }

    @Override
    public int type(TypeFactory typeFactory) {
        return typeFactory.type(this);
    }
}
